\chapter{Installation guide of {\it Elib} library and its tools} 
  \label{app:installelib}
  The following sections guide user on his first steps in e-Puck programming via {\it Elib}.
  First of all the requirements for running a sample $C\#$ program {\it TestElib} will be presented.
  Guide line how to explore and install the {\it TestElib} follows.
  The installation of {\it Elib} and {\it TestElib} differs 
  according your operating system and runtime.
  The possibilities are Mono \cite{mono} and .Net runtime. 
  Mono runs on Linux as well as on Windows. Microsoft runtime .Net
  runs only under Windows.

  The installation does register neither {\it Elib} nor {\it TestElib} into an operating system. 
  It enables a simple copy installation not needing of the administrator rights.
  \section{Requirements for running an e-Puck's first program}
  \label{sec:require}
  Let us suppose, that we have an e-Puck robot with {\it BTCom} 1.1.3 charged 
  and equipped with default programmes.
%  \footnote{\small{If you need download {\it BTCom} to e-Puck, follow the guide 
%  \url{http://www.e-puck.org/index.php?option=com_remository&Itemid=71&func=fileinfo&id=16}.}}
  Let us start with turned off e-Puck. Turn e-Puck on.
  A green LED shines if the e-Puck is on and the battery is not empty.
  The low state of battery is signalled by a small red LED next to the green LED. 
  If the red diode is blinking or shining take off the battery and let recharge it.

  We need a Bluetooth device, because we want to send commands to e-Puck via Bluetooth. Install it and assure,
  that it is working.
  At last, we need the runtime, which is necessary to run a compiled $C\#$ programs. 
  {\it Elib} library, {\it TestElib} and {\it Elib Tools} require .Net 2.0 or a higher version of .Net under Windows.
  To run the mentioned programs under Linux use at least version 2.0 of Mono runtime.
  A graphical application {\it Elib Joystick} and simple console application Simulator
  run only under Windows and {\it Elib Joystick} needs .Net 3.5 or higher.

  All programs are aimed at programmers and therefore we recommend the following 
  integrated development environments (IDE),
  which are serious benefits of $C\#$ programming.
  We published all programs in formats of 
  a Microsoft Visual Studio 2008 solution or a MonoDevelop solution.  
  Microsoft Visual Studio 2008 (MSVS) and MonoDevelop 2.4 IDEs 
  can be obtained freely for educational purposes.
  If at least one of the above IDEs is installed, all prerequisities 
  are fulfilled for a comfort exploration of presented examples. 
  They substitute compiler, editor and debugger and save a lot of work.
  All following examples suppose, that MonoDevelop or MSVS is installed.

  Last but not least we have to check it the e-Puck's selector is at the right position.
  E-puck is deployed with {\it BTCom} downloaded to its michrochip. 
  The {\it BTCom} is saved under the second position of selector. 
  Turn selector directly to e-Puck's microphone, shift it twice to the left 
  in order to choose {\it BTCom} from default settings.

  Prepare {\it Elib} library for an installation.
  
  \section{Copy installation} \label{sec:copy}
  Let us suppose that all preconditions from Section ~\ref{sec:require} are met.
  Let us describe the content of the {\it Elib} package.\\

  Both .Net and Mono technologies use a solution and projects files to group 
  a source codes of applications. We placed the project and solution files 
  together with the relevant source files in the following folders:

  \begin{enumerate}
          \item Folder { \sf elib} contains a solution with {\it Elib} project 
              and {\it TestElib} project. It contains {\it Elib} library project itself too.
          \item Folder { \sf testelib} contains only the project console {\it TestElib}, 
              which illustrates a typical applications of {\it Elib} library on sample programs.
          \item Folder { \sf et} contains solution and console project {\it Elib Tools}. 
            It allows process log files generated by programs,
            which use {\it Elib}.
          \item Folder { \sf joystick} hides a solution of a graphical application 
            {\it Elib Joystick}, which introduces e-Puck without programming. 
            On the other hand, it shows how to build a Wpf application, 
            which uses {\it Elib}, and its multithreaded asynchronous model.
          \item Folder { \sf simulator}  contains a very simple windows console 
            application Simulator and its solution. 
            Simulator requires VSPE emulator of serial port. 
            Simulator substitutes e-Puck by repeating constant answers. 
            It allows to test your application without e-Puck.
  \end{enumerate}

  The most significant parts are located in the first three folders.
  {\it Elib Joystick's} crucial programming techniques are described 
  in Appendix ~\ref{app:joystick}.
  The only other purpose of {\it Elib Joystick} is to provide a toy, 
  which can access e-Puck's sensors and actuators without no knowledge of programming.
  The Simulator application is on the other hand a simple tool for programmers, 
  who profile their application for e-Puck for a better performance.
  See its code for instructions how to use it and modify it.

  The applications {\sf et}, {\sf {\it Elib Joystick}}, {\sf Simulator}, 
  {\sf Elib} and {\sf {\it TestElib}}
  can be installed to your computer only by copying.
  If you are using MonoDevelop, choose folders with suffix "$\_monodev$". 
  Copy the appropriate folder to the desired location.
  In order to see the source files, open the downloaded folder, 
  select the solution file with suffix "$sln$" and open it with your IDE.
  Build the solution file in MSVS by pressing Ctrl + B and in MonoDevelop by pressing F7. 
  In order to run the program use Ctrl + F5 in both IDEs.
  {\it Elib Joystick} and {\it TestElib} applications use 
  a serial port to a communication with e-Puck. 
  The serial port has to be configured before running the applications.

  In order to configure the serial port turn your Bluetooth device and e-Puck on. 
  The devices can be paired together using an operating system specific application 
  for example Bluetooth Places on Windows and Bluetooth Manager on Linux. 
  The applications create a virtual serial port, but before connecting to the port
  the devices has to be paired.
  The process of pairing requires a four digit number (PIN), 
  which is the single number printed on e-Puck's body.
  After pairing the devices, connect to the serial port.
  The Bluetooth application assigns a serial port name to the e-Puck robot. 
  On Windows the port name looks like 'COM3'. 
  Linux port name has similar format like '/dev/rfcomm1'.
  The digits at the end of port names differs according to the situation.
  In order to achieve successful run of {\it Elib Joystick} or {\it TestElib} check
  whether the assigned port name match the port name used by {\it Elib Joystick} or {\it TestElib}.
  If the assigned port name differs from the port name used in {\it Elib Joystick}
  or in {\it TestElib} application, then replace the port name used in the applications by
  the new port name assigned by operating system.

  We believe, that all conditions for a successful use  of {\it Elib} has been presented. 
  Let us note, that the most problems are caused by the hardware.
  Assure that you switch both e-Puck and Bluetooth on. Take in mind, 
  that the red control for indicating e-Puck's low battery is not reliable,
  so we suggest fully charging the battery before the first use.

